<?php
namespace app\common\model\project_model;

use app\common\helper\Obj2Array;
use app\common\model\Base;
use think\Model;

class AlbumSkinModel extends Model {

    const STATUS_OK = 1;
    const STATUS_LOCK = 0;

    const IS_HOT_YES = 1;
    const IS_HOT_NO = 0;

    const IS_REMOTE_YES = 1;
    const IS_REMOTE_NO = 0;

    protected $table = 'ph_album_skin';

    public static function statusList() {
        return [
            self::STATUS_LOCK => '锁定',
            self::STATUS_OK => '启用'
        ];
    }

    public static function isHotList() {
        return [
            self::IS_HOT_NO => '普通',
            self::IS_HOT_YES => '火热',
        ];
    }

    public static function isRemoteList() {
        return [
            self::IS_REMOTE_NO => '本地',
            self::IS_REMOTE_YES => '远程',
        ];
    }

    public static function skinList() {
        $skinM = new self();
        $skinD = $skinM->field('title, name')->where(['status' => self::STATUS_OK])->order(['sort' => 'ASC'])->select();
        if (empty($skinD)) {
            return [];
        }
        return Obj2Array::resObject2Array($skinD);
    }

}